package com.emmmya.harinCheck.pojo;

import com.emmmya.harinCheck.annotation.Check;

import java.util.Date;

/**
 * @author Harin
 * @version 1.0
 * @date 2022-04-29 19:16:17
 */
public class TestEntity {
    @Check(name="用户名",required = true,maxLength = 16)
    private String username;

    @Check(name="密码",
            required = true,
            pattern = "^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,16}$",
            errorMsg = "强密码(必须包含大小写字母和数字的组合，可以使用特殊字符，长度在8-16之间)")
    private String password;

    @Check(name="性别",defaultValue = "1",maxValue = "100",minValue = "1")
    private Integer sex;

    @Check(name="状态" ,enumValues = Status.class, desc = "默认值成功")
    private Integer status = Status.SUCCESS.getCode();

    @Check(name="第一个数字",bigger = "第二个数字",desc = "必须比第二个数字大")
    private int a;

    @Check(name="第二个数字")
    private int b;

    @Check(name="出生日期",small = "当前日期")
    private Date birthday;

    @Check(name="当前日期")
    private Date now;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    public Date getBirthday() {
        return birthday;
    }

    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }

    public Date getNow() {
        return now;
    }

    public void setNow(Date now) {
        this.now = now;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }
}
